<template>
	<view class="container">
		<view style="text-align: right;color: red;font-size: 30rpx;padding-right: 20rpx;padding-top: 20rpx;"
			@tap="navigateTo('/pagesA/my/feedback/add')">添加留言</view>
		<view class="tui-records__list">
			<tui-list-cell :hover="false" v-for="(item, index) in datalist" :key="index"
				@tap="navigateTo('/pagesA/my/feedback/detail?id=' + item.id)">
				<view class="tui-records__item">
					<view>
						<view class="tui-title">{{ item.message }}</view>
						<view class="tui-desc">{{ item.create_time }}</view>
					</view>
				</view>
				<view class="tui-right__box">
					<view class="tui-desc">状态： <text :class="item.status ? 'tui-text-green' : 'tui-text-red'">{{
						item.status ? "已处理" : "未处理" }}</text></view>
				</view>
			</tui-list-cell>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			datalist: []
		}
	},
	onShow() {
		this.getList()
	},
	methods: {
		getList() {
			const _this = this
			_this.$request.post('Feedback.list', {
				page: 1,
				pageSize: 50
			}).then(res => {
				if (res.errno == 0) {
					_this.datalist = res.data
				} else {
					_this.datalist = []
				}
			})
		},
		navigateTo(url) {
			console.log(url)
			uni.navigateTo({
				url: url
			});
		},
	},
	onPullDownRefresh() { },
	onReachBottom() { }
}
</script>

<style>
.tui-text-green {
	color: green;
}

.tui-text-red {
	color: red;
}

.container {
	padding-bottom: env(safe-area-inset-bottom);
}

.tui-records__list {
	margin-top: 20rpx;
}

.tui-records__item {
	width: 100%;
	display: flex;
	align-items: center;
}

.tui-icon {
	width: 72rpx;
	height: 72rpx;
	margin-right: 20rpx;
}

.tui-title {
	font-size: 30rpx;
	font-weight: 400;
	color: #333333;
}

.tui-desc {
	font-size: 24rpx;
	font-weight: 400;
	color: #888888;
	padding-top: 12rpx;
}

.tui-right__box {
	margin-left: auto;
	text-align: right;
}

.tui-amount {
	font-size: 30rpx;
	font-weight: 400;
	color: #EB0909;
}

.tui-expend {
	color: #19be6b !important;
}
</style>
